home *** CD-ROM | disk | FTP | other *** search
- onClipEvent(enterFrame){
- if(this.hitTest(_root.ball))
- {
- gotoAndPlay(6);
- if(_root.vars.fireball == 0)
- {
- if(_root.ball._x < _X + 10 and _X - 10 < _root.ball._x and _Y - 3.5 < _root.ball._y)
- {
- _root.ball._y = _Y + _height / 2 + _root.ball._height / 2;
- _root.vars.bally *= -1;
- _root.sounds.blockhit_sfx.start(0.79,1);
- }
- if(_root.ball._x < _X + 10 and _X - 10 < _root.ball._x and _root.ball._y < _Y + 3.5)
- {
- _root.ball._y = _Y - _height / 2 - _root.ball._height / 2;
- _root.vars.bally *= -1;
- _root.sounds.blockhit_sfx.start(0.79,1);
- }
- if(_root.ball._x < _X - 5 and _Y - 3.5 < _root.ball._y and _root.ball._y < _Y + 3.5)
- {
- _root.ball._x = _X - _width / 2 - _root.ball._width / 2;
- _root.vars.ballx *= -1;
- _root.sounds.blockhit_sfx.start(0.79,1);
- }
- if(_X + 5 < _root.ball._x and _Y - 3.5 < _root.ball._y and _root.ball._y < _Y + 3.5)
- {
- _root.ball._x = _X + _width / 2 + _root.ball._width / 2;
- _root.vars.ballx *= -1;
- _root.sounds.blockhit_sfx.start(0.79,1);
- }
- if(_X + 10 < _root.ball._x and _Y + 3.5 < _root.ball._y)
- {
- if(_root.vars.ballx < 0 and 0 < _root.vars.bally)
- {
- _root.ball._x = _X + _width / 2 + _root.ball._width / 2;
- _root.vars.ballx *= -1;
- _root.sounds.blockhit_sfx.start(0.79,1);
- }
- if(0 < _root.vars.ballx and _root.vars.bally < 0)
- {
- _root.ball._x = _X + _width / 2 + _root.ball._width / 2;
- _root.vars.ballx *= -1;
- _root.sounds.blockhit_sfx.start(0.79,1);
- }
- if(_root.vars.ballx < 0 and _root.vars.bally < 0)
- {
- _root.ball._x = _X + _width / 2 + _root.ball._width / 2;
- _root.ball._y = _Y + _height / 2 + _root.ball._height / 2;
- _root.vars.ballx *= -1;
- _root.vars.bally *= -1;
- _root.sounds.blockhit_sfx.start(0.79,1);
- }
- }
- if(_X + 10 < _root.ball._x and _root.ball._y < _Y - 3.5)
- {
- if(_root.vars.ballx < 0 and _root.vars.bally < 0)
- {
- _root.ball._x = _X + _width / 2 + _root.ball._width / 2;
- _root.vars.ballx *= -1;
- _root.sounds.blockhit_sfx.start(0.79,1);
- }
- if(0 < _root.vars.ballx and 0 < _root.vars.bally)
- {
- _root.ball._x = _X + _width / 2 + _root.ball._width / 2;
- _root.vars.ballx *= -1;
- _root.sounds.blockhit_sfx.start(0.79,1);
- }
- if(_root.vars.ballx < 0 and 0 < _root.vars.bally)
- {
- _root.ball._x = _X + _width / 2 + _root.ball._width / 2;
- _root.ball._y = _Y - _height / 2 - _root.ball._height / 2;
- _root.vars.ballx *= -1;
- _root.vars.bally *= -1;
- _root.sounds.blockhit_sfx.start(0.79,1);
- }
- }
- if(_root.ball._x < _X - 10 and _root.ball._y < _Y - 3.5)
- {
- if(_root.vars.ballx < 0 and 0 < _root.vars.bally)
- {
- _root.ball._x = _X - _width / 2 - _root.ball._width / 2;
- _root.vars.ballx *= -1;
- _root.sounds.blockhit_sfx.start(0.79,1);
- }
- if(0 < _root.vars.ballx and _root.vars.bally < 0)
- {
- _root.ball._x = _X - _width / 2 - _root.ball._width / 2;
- _root.vars.ballx *= -1;
- _root.sounds.blockhit_sfx.start(0.79,1);
- }
- if(0 < _root.vars.ballx and 0 < _root.vars.bally)
- {
- _root.ball._x = _X - _width / 2 - _root.ball._width / 2;
- _root.ball._y = _Y - _height / 2 - _root.ball._height / 2;
- _root.vars.ballx *= -1;
- _root.vars.bally *= -1;
- _root.sounds.blockhit_sfx.start(0.79,1);
- }
- }
- if(_root.ball._x < _X - 10 and _Y + 3.5 < _root.ball._y)
- {
- if(_root.vars.ballx < 0 and _root.vars.bally < 0)
- {
- _root.ball._x = _X - _width / 2 - _root.ball._width / 2;
- _root.vars.bally *= -1;
- _root.sounds.blockhit_sfx.start(0.79,1);
- }
- if(0 < _root.vars.ballx and _root.vars.bally < 0)
- {
- _root.ball._x = _X - _width / 2 - _root.ball._width / 2;
- _root.vars.ballx *= -1;
- _root.vars.bally *= -1;
- _root.sounds.blockhit_sfx.start(0.79,1);
- }
- if(0 < _root.vars.ballx and 0 < _root.vars.bally)
- {
- _root.ball._x = _X - _width / 2 - _root.ball._width / 2;
- _root.ball._y = _Y + _height / 2 + _root.ball._height / 2;
- _root.vars.ballx *= -1;
- _root.sounds.blockhit_sfx.start(0.79,1);
- }
- }
- }
- else
- {
- _root.vars.score += Number(20);
- _root.sounds.blockhit_sfx.start(0.79,1);
- this.removeMovieClip();
- }
- }
- if(_root.vars.bullet == 1)
- {
- if(this.hitTest(_root.bullet1))
- {
- _root.sounds.blockhit_sfx.start(0.79,1);
- _root.vars.score += Number(20);
- _root.vars.bullet = 0;
- _root.bullet1.removeMovieClip();
- this.removeMovieClip();
- }
- }
- }
-